﻿namespace SenenFernandez.UniversalExtensions
{
    using System.Net;
    using System.Threading.Tasks;

    public static class Net
    {
        public static Task<WebResponse> GetReponseAsync(this WebRequest request, object state = null)
        {
            return Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, state);
        }
    }
}